package com.pcdandan.pcdandan.config.subject;

import java.util.List;

import com.pcdandan.pcdandan.config.token.PcdandanTicket;
import com.youyu.financial.gjj.crawler.pipeline.Pipeline;
import com.youyu.financial.gjj.crawler.principal.SimpleSubject;
import com.youyu.financial.gjj.crawler.principal.Ticket;
import com.youyu.financial.gjj.crawler.processor.ProcessorRegister;
import com.youyu.financial.gjj.crawler.session.SessionManager;
import com.youyu.financial.gjj.crawler.visitor.Visitor;

/**
 * 信用卡账单访问者
 * Created by xuzhengtao on 2018/4/17.
 */
public class PcdandanSubject extends SimpleSubject {
    public PcdandanSubject(Ticket ticket, ProcessorRegister processorRegister, SessionManager sessionManager, Visitor visitor, List<Pipeline> pipelines) {
        super(ticket, processorRegister, sessionManager, visitor, pipelines);
    }

    /**
     * 从ticket中获取执行的方法目标，并执行
     * @return
     */
    public Object doWork(){
    	PcdandanTicket ticket = (PcdandanTicket)this.getTicket();
        return this.executor().method(ticket.getMethod()).execute();
    }
}
